W-21432256: Salesforce Payments on PWA Feature#3722
W-21432256: Salesforce Payments on PWA Feature#3722
Conversation
* PWA on SFP spike * sfp on pwa part 1 * use new payment instrument request * conditionally render express box * add ShopperPayments tests * lint and tests * address comments * clean up --------- Co-authored-by: Jeff Raab <jraab@salesforce.com>
* render paypal * refactor shopper config checker
* refactor shopper config checker * baskets v2 temp commit * complete paypal and code clean up * address comments * fix
* @W-19685609 Express on PDP with Temporary Basket * Address Code Review: Fix comments, remove eagerly created validations, move temp basket to its a hook, i10n for errors, etc * Address Code Review: Fix additional comments, i10 labels, set keepPreviousData to false by default in current basket hook * Address Code Review: do not set keepPreviousData flag to true in useCurrentBasket hook until further testing confirms that it is needed * Address updates to SDK event changes in payment sheet * Remove the optional keepPreviousData property setting in usecurrentbasket hook * Undo i10 call for an error that nees to be looged into console only * Reset maximumButtonCount to 1 * Remove commented line * Replace undefined with empty function for onclick action in payment sheet
…/sfp-update-amount-prevent-reinit @W-20117176 : Call updateAmount on Order Total change
* W-19443266: Handle Failure use-cases by calling Fail Order where necessary. Also refactor the client-secret retrieval since the response structure has changed.
…/order-confirmation-hide-sfp-payment-details @W-19799923: Remove payment details on order confirmation page for SFP orders
…/fail-order-on-redirect W-21372336: Fail Order for redirect based payments
…/stripe-caching-for-display-spm-fix-tests W-21411273, W-21434212: Fix for Display SPMs at checkout due to caching issues and Fix for failing tests on feature branch
…/merge-changes-from-develop W-21436534: Merge from Develop to feature branch
* W-21432256: address code review comments from PWA team
…/payment-sheet-zone-id W-21324157: Zone ID updated to use paymentconfig zoneID in Payment Sheet
…-20911530-UT W-20911530: fixing failing unit test
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Made-with: Cursor
|
Changes in the One click checkout files look good to me.Approved. |
| // Set enabled to true to enable Salesforce Payments (requires the Salesforce Payments feature toggle to be enabled on the Commerce Cloud instance). | ||
| // Set enabled to false to disable Salesforce Payments on the storefront (the Commerce Cloud feature toggle is unaffected). | ||
| // sdkUrl and metadataUrl are hosted on your Commerce Cloud instance. Replace <hostname> with your instance hostname. | ||
| // This may be a demandware.net hostname (e.g., myinstance.unified.demandware.net) or a vanity/custom hostname. |
There was a problem hiding this comment.
I'm not sure a demandware.net hostname is allowed due to origin blocking. I think this has to be a vanity domain.
Also, could a proxy to commerce cloud work? Ie. https://<PWA Kit hostname>/mobify/proxy/ocapi/on/demandware.static/Sites-Site/-/-/internal/jscript/sfp/v1/sfp where /mobify/proxy/ocapi is set up to route requests to ecom?
There was a problem hiding this comment.
I really don't know how the vanity urls work and how the production urls even look like. Our internal ODS systems tend to have demandware.net. So I said 'maybe' but if we have a definitive pattern on how these urls look like in production, we can change that comment
There was a problem hiding this comment.
| @@ -1,4 +1,5 @@ | |||
| ## v9.1.0-dev | |||
| - [Feature] Add Salesforce Payments support in checkout | |||
There was a problem hiding this comment.
Nit: Let's update the changelog entry with a link to this PR
| protocol: process.env.DEV_SERVER_PROTOCOL || 'http', | ||
|
|
||
| // SSL file path for HTTPS development | ||
| sslFilePath: process.env.DEV_SERVER_SSL_FILE_PATH, |
There was a problem hiding this comment.
Do these need to be added to the ssr.js templates in the pwa-kit-create-app generator>
There was a problem hiding this comment.
We only added it to the local development template and not to the handlebar files. local host requires ssl and https for payments, else development and debugging is not possible. But something to discuss
| @@ -1,4 +1,5 @@ | |||
| ## v5.1.0-dev | |||
| - Bump commerce-sdk-isomorphic to 5.1.0 | |||
There was a problem hiding this comment.
Nit: Let's add he link for this PR to this changelog entry
| @@ -0,0 +1,470 @@ | |||
| /* | |||
| * Copyright (c) 2025, salesforce.com, inc. | |||
There was a problem hiding this comment.
Nit: Let's update these to 2026
| import {useToast} from '@salesforce/retail-react-app/app/hooks/use-toast' | ||
| import {PAYMENT_GATEWAYS} from '@salesforce/retail-react-app/app/constants' | ||
|
|
||
| // const ADYEN_SUCCESS_RESULT_CODES = [ |
There was a problem hiding this comment.
We can clean this up I think
| import {useCurrentBasket} from '@salesforce/retail-react-app/app/hooks/use-current-basket' | ||
| import {AuthHelpers, useAuthHelper, useShopperBasketsMutation} from '@salesforce/commerce-sdk-react' | ||
| import {isAbsoluteURL} from '@salesforce/retail-react-app/app/page-designer/utils' | ||
| import {useAppOrigin} from '@salesforce/retail-react-app/app/hooks/use-app-origin' |
There was a problem hiding this comment.
Are these imports for isAbsoluteURL and useAppOrigin needed?
| 'google.com', | ||
| 'www.google.com' |
There was a problem hiding this comment.
After the merge, as discussed in this comment from the previous PR, please update it to be more narrow scoped. Thanks.
There was a problem hiding this comment.
Sure, we will need to verify it and run some E2E to make sure we capture the exact domains since we don't want to be in a situation where the feature breaks either because of CSP
vcua-mobify
left a comment
There was a problem hiding this comment.
Following a sync meet, the remaining comments will be addressed in a quick follow PR
|
This PR has been squash merged to |


This PR is in continuation of #3709, has been raised to resolve
cla:missinglabel.This PR spans 3 packages with ~15,165 lines added across 120 files (including tests and translations). The changes enable Stripe, Adyen, and PayPal payment processing via the SF Payments SDK, with both standard checkout and express payment flows (Apple Pay, Google Pay, PayPal, Venmo).
Gus item: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002VgsrOYAR/view
Description
This document summarizes the Salesforce Payments on PWA Feature:
https://salesforce.quip.com/UErWA4QiaiES
Areas that are common and can be reviewed further include
Areas that are Domain/Payments specific
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization